package com.java.mall_imooc.service;

import com.java.mall_imooc.common.utils.R;
import com.java.mall_imooc.entity.Cart;
import com.java.mall_imooc.form.CartAddForm;
import com.java.mall_imooc.form.CartUpdateForm;
import com.java.mall_imooc.vo.CartVo;

import java.util.List;

/**
 * @author jiangli
 * @since 2020-03-16 21:17
 */
public interface CartService {

    R<CartVo> list(Integer userId);

    R<CartVo> add(CartAddForm addForm, Integer userId);

    R<CartVo> update(Integer userId, Integer productId, CartUpdateForm cartUpdateForm);

    R<CartVo> delete(Integer userId, Integer productId);

    R<CartVo> selectAll(Integer userId);

    R<CartVo> unSelectAll(Integer userId);

    R<Integer> sum(Integer userId);

    List<Cart> carts(String key);
}
